<template>
  <van-config-provider :theme-vars="themeVars" @touchmove="handleTouch">
    <router-view></router-view>
    <!-- v-if="loading" -->
    <section v-if="loading" class="loading-body">
      <div class="loading-content">
        <van-loading size="36" color="#ffffff" />
      </div>
    </section>
    <van-number-keyboard safe-area-inset-bottom />
  </van-config-provider>
</template>

<script setup>
import { useStoreApp } from "@/store";
import { reactive } from "vue";
const storeApp = useStoreApp();
const loading = computed(() => storeApp.loading);
const themeVars = reactive({
  buttonPrimaryBackgroundColor: '#FED60F',
  buttonPrimaryBorderColor: '#FED60F',
  primaryColor: "#FED60F",
  tabsBottomBarColor: "#FED60F",
  calendarRangeEdgeBackgroundColor: "#FED60F",
  buttonDangerBackgroundColor: "#FED60F",
  buttonDangerBorderColor: "#FED60F",
  calendarRangeMiddleColor: "#FED60F",
  dialogConfirmButtonTextColor: "#FED60F",
});


// const store = useStore();
// const loading = computed(() => store.state.loading);
function handleTouch(e) {
  e._isScroller = true;
}
</script>

<style lang="less">
@import url('./style/init.less');
body,
html {
  width: 100%;
  height: 100%;
  font-size: 32px;
  overflow: hidden;
}
#app {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #323233;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  // background: #f4f5f6;
  background: #F8F8F8;
  word-break: break-all;
  .van-config-provider {
    height: 100%;
  }
}

.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}

.van-dialog {
  border-radius: 0 !important;
}
.loading-body {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  .loading-content {
    width: 220px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.7);
  }
}
#nprogress {
  .bar,
  .peg {
    background-color: #edb66f !important;
    box-shadow: none !important;
  }
}
</style>
